package com.springboot.demo.mapper;


import com.springboot.demo.model.User;
import com.springboot.demo.model.UserExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 *  如果SpringbootApplication中配置了
 *  @MapperScan(value = "com.springboot.demo.mapper")注解
 *  则相当于批量扫描了mapper，不必每个mapper再加@Mapper注解
 *
 *  如果两个注解均不加，会报如下异常：
 *  Action:
 *  Consider defining a bean of type 'com.springboot.demo.mapper.UserMapper' in your configuration.
 */
//@Mapper
public interface UserMapper {
    int countByExample(UserExample example);

    int deleteByExample(UserExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    List<User> selectByExample(UserExample example);

    User selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);

    int updateByExample(@Param("record") User record, @Param("example") UserExample example);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);
}